<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript" src="${staticPath}/js/intent/intAssociated_list.js"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
function btnOK_click(){
	var contextPath = Com_Parameter.ContextPath;
	var ids = new Array(), i = 0;
	$('#modalTable').find("input[type='checkbox'][data-ckb-id]").each(function(){
		var $this = $(this);
		if($this.prop('checked')){
			ids.push($(this).attr("data-ckb-id"))  ;
		}
	});
	if(ids.length < 1){
		top.$.jBox.tip('请选择一条洽谈记录','warning');
		return;
	}
	if(ids.length > 1){
		top.$.jBox.tip('只能选择一条洽谈记录','warning');
		return;
	}
	var id = ids[0];
	$("#ok").attr("data-dismiss","modal");
	$("#intentForm").attr("action","${contextPath}/biz/intent/intLeaseociated/"+id+"/${navId}/add");
	$("#intentForm").submit();
}
</script>
<div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">选择意向洽谈记录</h4>
            </div>
             <form id="intentForm" action="" method="get"></form>
             <div class="modal-header">
            	 <div class="col-sm-3  f_6">
               		<select id="negotiationType"  class="f_5" name="negotiationType" >
               			<option value="">--洽谈类型--</option>
               			<option value="20">新签</option>
               			<option value="30">续签</option>
               			<option value="40">展期</option>
               			<option value="70">变更</option>
               		
               		</select>
                </div>
                 <div class="col-sm-2  f_6">
               		 <input type="text" id="suppliername" name="supplierName" maxlength="200" placeholder="供应商名称"/>
                </div>
                <div class="col-sm-2  f_6">
                	 <input type="text" id="brandCName" name="brandCName" maxlength="200" placeholder="品牌名称"/>
                </div>
                <div class="col-sm-3  f_6">
               		 <button type="button" id="queryNegotiation" class="btn btn-success btn-sm Paging_3">查询</button>
                </div>
            </div>
            <div class="modal-body">
		<table class="table table-striped table-hover " id="modalTable">
				<thead>
					<tr>
						<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
							<th>洽谈类型</th>
							<th>是否变更</th>
							<th>洽谈号</th>
							<th>供应商号</th>
							<th>供应商名称</th>
							<th>区域</th> 
							<th>所属门店</th>
					</tr>
				</thead>
			<tbody id="negotiationTbody">
				<c:forEach items="${page.list}" var="assrecord">
					<tr  data-target="_self">
						<td class="o-l-tab-ckb" >
							<input type="checkbox" data-ckb-id="${assrecord.id}">
						</td>
						<td><ossp:value dictType="CONTRATC_ATTRIBUTE" key="${assrecord.assinfo.negotiationType}"></ossp:value></td>
						<td><ossp:value dictType="YESORNO" key="${assrecord.assinfo.isModifyContract}"></ossp:value></td>
						<td >${assrecord.assinfo.number}</td>
						<td >${assrecord.assinfo.supplierNo}</td>
						<td >${assrecord.assinfo.supplierName}</td>
						<td >${assrecord.assinfo.area}</td> 
						<td >${assrecord.assinfo.store}</td> 
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="Paging">
             <div class="col-xs-6">
             		<input type="hidden" id="pageNo" value="${page.pageNo}">
             		<input type="hidden" id="pageSize" value="${page.pageSize}">
             		<input type="hidden" id="total" value="${page.total}">
                  <ul class="pagination">
						<li id="lastPageLi" class="disabled"><a href="#" id="lastPage">&laquo;&nbsp;上一页</a>
						</li>
                      	<li id="nextPageLi"><a href="#" id="nextPage">下一页&nbsp;&raquo;</a></li>
                  </ul>
             </div>
             <div class="col-xs-6">
                  <div class="pull-right">
                       <span class="Paging_2" id="pageNoSpan">第${page.pageNo}页</span>&nbsp;&nbsp;
                       <span class="Paging_2" id="totalSizeSpan">共${totalSize}页</span>
                       <span>到</span><input class="form-control_1 input-sm input-goto MaoYe-form-TiaoZhuan" id="gotoPageNo" name="gotoPageNo" type="text">
                       <span>页</span>
                       <button type="button" id="goto" class="btn btn-default btn-sm Paging_3">跳转</button>
                  </div>
             </div>
        </div> 
            </div>			
            <!-- /modal-body -->
            <div class="modal-footer">
                <button type="button" id="ok"  onclick="btnOK_click()"  class="btn btn-primary">确定</button>
                 <button type="button"  class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>			
            <!-- /modal-footer -->
        </div>         
        <!-- /modal-content -->
    </div>     
</body>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>